/*
 * JPanelWizardClaseSimpleFinish.java
 *
 * Created on 11-abr-2012, 21:50:37
 */
package com.ufps.cuatro.vistas.asistente.clase.vinculadora;

import com.ufps.cuatro.modelo.analizador.ObjetoReflexion;
import com.ufps.cuatro.modelo.representacion.ObjetoTipoDatoReflexion;
import com.ufps.cuatro.modelo.representacion.UtilRepresentacion;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.event.ListDataListener;
import org.jdesktop.application.Action;

/**
 *
 * @author Catc
 */
public class JPanelWizardClaseVinculadoraFinish extends javax.swing.JPanel {
    private static final long serialVersionUID = -4825775907629206487L;
    
    private ObjetoTipoDatoReflexion objTipoDato;
    private final ArrayList<ObjetoReflexion> objMetodos;
    private ArrayList<ObjetoReflexion> objMetodosDisponibles;
    private ArrayList<ObjetoReflexion> objMetodosAgregados;
    private final ArrayList<ObjetoReflexion> objMetodosSinRepresentacion;

    /** Creates new form JPanelWizardClaseSimpleFinish */
    public JPanelWizardClaseVinculadoraFinish(ObjetoTipoDatoReflexion objTipoDato) {
        initComponents();
        this.objTipoDato = objTipoDato;        
        this.jLabelClase.setText(objTipoDato.getStrClassPath());        
        objMetodos = UtilRepresentacion.devolverPropiedadesClase(objTipoDato.getObjClass(), UtilRepresentacion.PROPIEDADES_METODOS_SALIDA, false);
        objMetodosSinRepresentacion = UtilRepresentacion.devolverPropiedadesClase(objTipoDato.getObjClass(), UtilRepresentacion.PROPIEDADES_METODOS_SALIDA, true);
        
        objMetodosDisponibles = new ArrayList<ObjetoReflexion>();
        objMetodosAgregados = new ArrayList<ObjetoReflexion>();
        
        objMetodosDisponibles.addAll(objMetodos);        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel2 = new javax.swing.JLabel();
        jLabelClase = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jCheckBoxConfirmar = new javax.swing.JCheckBox();

        jLabel2.setText("Clase:");
        jLabel2.setName("jLabel2"); // NOI18N

        jLabelClase.setBackground(new java.awt.Color(255, 255, 255));
        jLabelClase.setText("Información de la Clase");
        jLabelClase.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabelClase.setName("jLabelClase"); // NOI18N
        jLabelClase.setOpaque(true);

        jLabel4.setBackground(new java.awt.Color(255, 255, 255));
        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ufps/cuatro/resources/icono app x 48.png"))); // NOI18N
        jLabel4.setText("<html><b>Bienvenido al Asistente de Representaciones de Vinculos de Referencias.</b><br> <p> Este asistente le permitirá generar Vistas Vinculadas de Tipos de Datos desde Colecciones.</p></html>");
        jLabel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel4.setName("jLabel4"); // NOI18N
        jLabel4.setOpaque(true);

        jCheckBoxConfirmar.setFont(new java.awt.Font("Tahoma", 1, 11));
        jCheckBoxConfirmar.setText("<html>Confirma la Configuración Actual para Generar una Nueva Vista Vinculada.</html>");
        jCheckBoxConfirmar.setName("jCheckBoxConfirmar"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4, 0, 0, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelClase, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE))
                    .addComponent(jCheckBoxConfirmar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabelClase))
                .addGap(18, 18, 18)
                .addComponent(jCheckBoxConfirmar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    @Action
    public void add() {
    }

    @Action
    public void addAll() {
    }

    @Action
    public void del() {
    }

    @Action
    public void delAll() {
    }

    @Action
    public void help() {
    }
    
    public ArrayList<ObjetoReflexion> getObjMetodosAgregados() {
        return objMetodosAgregados;
    }

    public ObjetoTipoDatoReflexion getObjTipoDato() {
        return objTipoDato;
    }
    
    public void addCheckBoxActionListener(ActionListener l) {
        jCheckBoxConfirmar.addActionListener(l);
    }
    
    public boolean isCheckBoxSelected() {
        return jCheckBoxConfirmar.isSelected();
    }  
    
    public boolean isListEmpty(){
        return this.objMetodosAgregados.isEmpty();
    }
    
    public void addListDataListener(ListDataListener i){
        //this.jListAgregadas.getModel().addListDataListener(i);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JCheckBox jCheckBoxConfirmar;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabelClase;
    // End of variables declaration//GEN-END:variables
}
